home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11216 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  790 b 

  1. Path: news.asu.edu!simoner
  2. From: simoner@imap2.asu.edu
  3. Newsgroups: comp.lang.c++
  4. Subject: structs as member of classes
  5. Date: 13 Mar 1996 07:33:33 GMT
  6. Organization: Arizona State University
  7. Message-ID: <4i5tod$qhe@news.asu.edu>
  8. NNTP-Posting-Host: general5.asu.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. I get the error
  12.  
  13. Error: Character::CharPlayer may not be a type name.
  14. Error: Badly formed expression.
  15.  
  16. when trying to change the value in a struct which is a private member of 
  17. a class.
  18. here is the code.
  19.  
  20. void Character::init_player()
  21. {
  22.         CharPlayer.PlrSts.strength = 15;
  23.         ...
  24. }
  25.  
  26. and the call is
  27.  
  28. player1.init_player();
  29.  
  30. I realize this is probably just a lame syntax problem, but it has irked 
  31. me for a couple of hours.  Seeing I don't have a manual.
  32. Thanks in advance.
  33. -Simon
  34.